/// @tags: Simulation
#include <cstdio>
#include <iostream>

using std::cin, std::cout, std::endl;

namespace BlueQuantum {

constexpr int maxn = 5e1 + 1, maxm = 1e3 + 1;

int map[maxn][maxn], cnt[maxn][maxn];
char str[maxm];

void update(int n) {
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) {
      map[i][j] += cnt[i][j];
      cnt[i][j] += 1;
    }
  }
}

int main() {
  int n, m, x, y;
  cin >> n >> m >> x >> y;
  cin >> (str + 1);
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) {
      cnt[i][j] = 1;
    }
  }
  cnt[x][y] = 0;
  update(n);
  for (int i = 1; i < m; ++i) {
    switch (str[i]) {
      case 'N':
        y += 1;
        cnt[x][y] = 0;
        update(n);
        break;
      case 'E':
        x += 1;
        cnt[x][y] = 0;
        update(n);
        break;
      case 'S':
        y -= 1;
        cnt[x][y] = 0;
        update(n);
        break;
      case 'W':
        x -= 1;
        cnt[x][y] = 0;
        update(n);
        break;
    }
  }
  for (int i = n; i; --i) {
    for (int j = 1; j <= n; ++j) {
      cout << map[j][i] << ' ';
    }
    cout << endl;
  }
  return 0;
}

}  // namespace BlueQuantum

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("/tmp/CodeTmp/testdata.in", "r", stdin);
  freopen("/tmp/CodeTmp/testdata.out", "w", stdout);
#else
  freopen("External.in", "r", stdin);
  freopen("External.out", "w", stdout);
#endif
#endif

  std::ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  return BlueQuantum::main();
}
